import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgZorroAntdModule } from 'ng-zorro-antd';

import { HomeInertiaRoutingModule } from './home-inertia-routing.module';
import { HomeComponent } from './home/home.component';
import { BusinessIntroductionComponent } from './business-introduction/business-introduction.component';
import { CarouselComponent } from './carousel/carousel.component';
import { HeadingComponent } from './heading/heading.component';
import { OpusDisplayComponent } from './opus-display/opus-display.component';
import { SynopsisComponent } from './synopsis/synopsis.component';
import {NewsComponent} from './news/news.component';
import { Router } from '@angular/router';

declare var $: any;

@NgModule({
  declarations: [
    HomeComponent,
    BusinessIntroductionComponent,
    CarouselComponent,
    HeadingComponent,
    OpusDisplayComponent,
    SynopsisComponent,
    NewsComponent,
  ],
  imports: [
    CommonModule,
    HomeInertiaRoutingModule,
    NgZorroAntdModule
  ],
  providers: []
})
export class HomeInertiaModule {
  constructor(public router: Router) { }
  ngOnInit(): void {
    // 进入路由滚动条置顶
    this.router.events
      .subscribe((event) => {
        $(window).scrollTop(0);
      });

  }

}
